import { dbQuery } from "../util/db";
import { KeyValue } from "../util/param";

// 查询浏览记录数
export const SelectBrowseCount = () => {
  return dbQuery(`SELECT count(*) FROM browse`);
};

export const AddBrowse = (query: KeyValue) => {
  return dbQuery(
    `INSERT INTO browse(
        ip,
        login_time
        ) VALUES(
          ?,
          ?
          )`,
    [query.ip, new Date().getTime()]
  );
};
